import 'package:flutter/material.dart';
import 'package:flutter_animator/flutter_animator.dart';
import 'package:flutter_easyloading/flutter_easyloading.dart';
import 'package:get/get.dart';
import 'package:jm_flutter/jm_flutter.dart';
import '../routers/routes.dart';

class InitPage extends StatefulWidget {
  const InitPage({Key? key}) : super(key: key);

  @override
  _InitPageState createState() => _InitPageState();
}

class _InitPageState extends State<InitPage> {
  final tag = "InitPage";

  init() async {
    delay(1000, () {
      //gotoNamedAndOffAll(Pages.home);
    });
  }

  @override
  void initState() {
    // TODO: implement initState
    super.initState();
    delay(1000, () {
      // if (isFirstUse &&
      //     !G_googlePlay &&
      //     Platform.isAndroid &&
      //     I18n.isSystemCn) {
      //   Get.dialog(
      //     PrivacyStatementDialog(onAgree: () {
      //       setFirstUse();
      //       init();
      //     }),
      //   );
      // } else {
      init();
      //}
    });
  }

  @override
  void dispose() {
    //I_18N_Context = null;
    // TODO: implement dispose
    super.dispose();
  }

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      body: Column(
        mainAxisAlignment: MainAxisAlignment.center,
        children: [
          SlitInDiagonal(
            child: Container(
              alignment: Alignment.center,
              //padding: const EdgeInsets.only(bottom: 40),
              child:
                  SizedBox(height: 100, child: MyImage("assets/img/logo.png")),
            ),
          ),
          gapv16,
          LightSpeedIn(child: MyText("-- JM 制作 --"))
        ],
      ),
    );
  }
}
